(function($) {
	var methods = {
			"init": function(options){
				$.extend( $.mprntpi.global, options );
				return this.each(function(){
					$.mprntpi.create();
				});
			}
		};

	$.mprntpi = {};
	
	$.mprntpi.global = {
			//global variables
	};
	
	$.fn.marcParent = function( method ) {	    
		// Method calling logic
		if ( methods[method] ) {
			return methods[ method ].apply( this, Array.prototype.slice.call( arguments, 1 ));
		} else if ( typeof method === 'object' || ! method ) {
			return methods.init.apply( this, arguments );
		} else {
			$.error( 'Method ' +  method + ' does not exist on jQuery.dialogPrompt' );
		}
	};
	
	$.mprntpi.create = function()
	{
		//build out admin menu
		var _appBody = $('#appBody');
		
		_appBody.append(
			$('<ul/>')
				.append($('<li/>')
					.append($('<a/>')
						.attr('href','#tabHome')
						.text('Home')
					)
				)
				.append($('<li/>')
					.append($('<a/>')
						.attr('href','#tabUser')
						.text('Settings')
					)
				)
				.append($('<li/>')
					.append($('<a/>')
						.attr('href','#tabStudents')
						.text('My Students')
					)
				)
				.append($('<li/>')
					.append($('<a/>')
						.attr('href','#tabReports')
						.text('Reports')
					)
				)
			)
			.append($('<div/>')
				.attr('id','tabHome')
			)
			.append($('<div/>')
				.attr('id','tabUser')
			)
			.append($('<div/>')
				.attr('id','tabStudents')
			)
			.append($('<div/>')
				.attr('id','tabReports')
			);
		
		$.mprntpi.buildHomeTab();
		$.mprntpi.buildUserTab();
		$.mprntpi.buildStudentsTab();
		$.mprntpi.buildReportsTab();
		
		$('#appBody').tabs();
	};
	
	$.mprntpi.buildHomeTab = function()
	{
		_containingDiv = $('#tabHome');
		
		var _homeMenu = 
			$('<ul/>')
				.append($('<li/>')
					.append($('<a/>')
						.attr('href','#')
						.text('At A Glance')
					)
				)
				.append($('<li/>')
					.append($('<a/>')
						.attr('href','#')
						.text('Notifications')
					)
				)
				.append($('<li/>')
					.append($('<a/>')
						.attr('href','#')
						.text('Ministry Calendar')
					)
				)
				.append($('<li/>')
					.append($('<a/>')
						.attr('href','#')
						.text('Contact Us')
					)
				);
		
		_homeMenu.menu();
		_containingDiv.append(_homeMenu);
	};
	
	$.mprntpi.buildUserTab = function()
	{
		_containingDiv = $('#tabUser');
		
		var _settingsMenu = 
			$('<ul/>')
				.append($('<li/>')
					.append($('<a/>')
						.attr('href','#')
						.text('Personal Info')
					)
				)
				.append($('<li/>')
					.append($('<a/>')
						.attr('href','#')
						.text('My Students')
					)
				)
				.append($('<li/>')
					.append($('<a/>')
						.attr('href','#')
						.text('Notify Me When...')
					)
				);
		
		_settingsMenu.menu();
		_containingDiv.append(_settingsMenu);
	};
	
	$.mprntpi.buildStudentsTab = function()
	{
		_containingDiv = $('#tabStudents');
		
		var _studentsMenu = 
			$('<ul/>')
				.append($('<li/>')
					.append($('<a/>')
						.attr('href','#')
						.text('Current Students')
					)
				)
				.append($('<li/>')
					.append($('<a/>')
						.attr('href','#')
						.text('New Student')
					)
				)
				.append($('<li/>')
					.append($('<a/>')
						.attr('href','#')
						.text('New Alias')
					)
				);
		
		_studentsMenu.menu();
		_containingDiv.append(_studentsMenu);
	};
	
	$.mprntpi.buildReportsTab = function()
	{
		_containingDiv = $('#tabReports');
		
		var _reportMenu = 
			$('<ul/>')
				.append($('<li/>')
					.append($('<a/>')
						.attr('href','#')
						.text('Attendance')
					)
				)
				.append($('<li/>')
					.append($('<a/>')
						.attr('href','#')
						.text('Tardiness')
					)
				)
				.append($('<li/>')
					.append($('<a/>')
						.attr('href','#')
						.text('Alias Usage')
					)
				);
		
		_reportMenu.menu();
		_containingDiv.append(_reportMenu);
	};
})(jQuery);